﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Core.Memceched;
using System.Collections.Generic;

namespace Memceched
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int timer = DateTime.Now.Millisecond;
                this.gvInitialize();
                Response.Write(DateTime.Now.Millisecond - timer);
            }
        }

        #region
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            if (Cache_Info.RemoveCache("Info_key"))
            {
                Response.Write("清除成功！");
            }
            else
            {
                Response.Write("清除失败！");
            }
            this.gvInitialize();
        }
        #endregion

        #region
        protected void btnInitialize_Click(object sender, EventArgs e)
        {
            this.gvInitialize();
        }
        #endregion

        #region
        private void gvInitialize()
        {
            this.GridView1.DataSource = Cache_Info.GetInfo();
            this.GridView1.DataBind();

        }
        #endregion
    }
}
